package com.xydtech.ecard.flow.service.impl;

import java.util.List;
import com.xydtech.common.utils.DateUtils;
import com.xydtech.ecard.flow.domain.EcardBusiFlowLink;
import com.xydtech.ecard.flow.mapper.EcardBusiFlowLinkMapper;
import com.xydtech.ecard.flow.service.IEcardBusiFlowLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xydtech.common.core.text.Convert;

/**
 * 电子名片业务流程关联Service业务层处理
 *
 * @author xydtech
 * @date 2024-07-26
 */
@Service
public class EcardBusiFlowLinkServiceImpl implements IEcardBusiFlowLinkService
{
    @Autowired
    private EcardBusiFlowLinkMapper ecardBusiFlowLinkMapper;

    /**
     * 查询电子名片业务流程关联
     *
     * @param instanceId 电子名片业务流程关联主键
     * @return 电子名片业务流程关联
     */
    @Override
    public EcardBusiFlowLink selectEcardBusiFlowLinkByInstanceId(String instanceId)
    {
        return ecardBusiFlowLinkMapper.selectEcardBusiFlowLinkByInstanceId(instanceId);
    }

    /**
     * 查询电子名片业务流程关联列表
     *
     * @param ecardBusiFlowLink 电子名片业务流程关联
     * @return 电子名片业务流程关联
     */
    @Override
    public List<EcardBusiFlowLink> selectEcardBusiFlowLinkList(EcardBusiFlowLink ecardBusiFlowLink)
    {
        return ecardBusiFlowLinkMapper.selectEcardBusiFlowLinkList(ecardBusiFlowLink);
    }

    /**
     * 条件查询没有结束的业务流程
     *
     * @param ecardBusiFlowLink 电子名片业务流程关联
     * @return 电子名片业务流程关联
     */
    @Override
    public List<EcardBusiFlowLink> getNoEndBusiFlowList(EcardBusiFlowLink ecardBusiFlowLink)
    {
        return ecardBusiFlowLinkMapper.getNoEndBusiFlowList(ecardBusiFlowLink);
    }

    /**
     * 新增电子名片业务流程关联
     *
     * @param ecardBusiFlowLink 电子名片业务流程关联
     * @return 结果
     */
    @Override
    public int insertEcardBusiFlowLink(EcardBusiFlowLink ecardBusiFlowLink)
    {
        ecardBusiFlowLink.setCreateTime(DateUtils.getNowDate());
        return ecardBusiFlowLinkMapper.insertEcardBusiFlowLink(ecardBusiFlowLink);
    }

    /**
     * 修改电子名片业务流程关联
     *
     * @param ecardBusiFlowLink 电子名片业务流程关联
     * @return 结果
     */
    @Override
    public int updateEcardBusiFlowLink(EcardBusiFlowLink ecardBusiFlowLink)
    {
        return ecardBusiFlowLinkMapper.updateEcardBusiFlowLink(ecardBusiFlowLink);
    }

    /**
     * 批量删除电子名片业务流程关联
     *
     * @param instanceIds 需要删除的电子名片业务流程关联主键
     * @return 结果
     */
    @Override
    public int deleteEcardBusiFlowLinkByInstanceIds(String instanceIds)
    {
        return ecardBusiFlowLinkMapper.deleteEcardBusiFlowLinkByInstanceIds(Convert.toStrArray(instanceIds));
    }

    /**
     * 删除电子名片业务流程关联信息
     *
     * @param instanceId 电子名片业务流程关联主键
     * @return 结果
     */
    @Override
    public int deleteEcardBusiFlowLinkByInstanceId(String instanceId)
    {
        return ecardBusiFlowLinkMapper.deleteEcardBusiFlowLinkByInstanceId(instanceId);
    }

}
